import java.util.Random;
import java.util.Scanner;
public class test {
    public static void main(String[] args) {
        Random random = new Random();
        int guess = random.nextInt(100);
        Scanner scanner = new Scanner(System.in);
        while(true){
            System.out.println("请输入0-100之间的数字：");
            int num = scanner.nextInt();
            if(num<guess){
                System.out.println("猜小了");
            }else if(num>guess){
                System.out.println("猜大了");
            }else{
                System.out.println("猜对了,是"+num);
                break;
            }
        }
    }
}
